<%@ page import="java.util.ArrayList" %>
<%@ page import="com.skeyedu.pojo.Person" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
	<title>Title</title>
</head>
<body>
<%
  ArrayList<Person> person = new ArrayList<>();
  person.add(0, new Person(1, "张三"));
  person.add(1, new Person(2, "李四"));
  person.add(2, new Person(3, "王五"));
  person.add(3, new Person(4, "赵六"));
  person.add(4, new Person(5, "田七"));
  request.setAttribute("list" ,person);
%>

<%--
  var 每一次遍历出来的对象
  item 要遍历的对象
  begin 从哪里开始
  end 到哪里结束
  step 步长
--%>
<c:forEach var="item" items="${list}">
  <c:out value="${item.getName()}" /> <br>
</c:forEach>

<c:forEach begin="1" end="5" step="2" var="item" items="${list}">
  <c:out value="${item.getName()}" /> <br>
</c:forEach>
</body>
</html>
